<%@ page language="java"  pageEncoding="UTF-8" contentType="text/html; charset=utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>共享设置one</title>
<link href="${pageContext.request.contextPath}/ui/css/style_cn.css" rel="stylesheet" type="text/css">
<script src="${pageContext.request.contextPath}/ui/js/win.js" type="text/javascript"></script>

<script src="${pageContext.request.contextPath}/ui/js/jquery-1.4.2.js" type="text/javascript"></script>
<style type="text/css">
<!--
fieldset div {
	float:left;
	width:24%;
	text-align:left;
	line-height:25px;
}
td div {
	float:left;
	width:24%;
	text-align:left;
	line-height:25px;
}
body {
	padding:5px;
}
-->
</style>

<script language="javascript">
function forward(strURL){
    window.location=strURL;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
function goView(){
	var id=$("#id").val();
	//var url = "${pageContext.request.contextPath}/crm/companyAction_other.do?method=showShareViewOne&id="+id;
	var url = "${pageContext.request.contextPath}/crm/customer/base/shareViewOne.jsp";
	forward(url);
}

function goCancel(){	
	var id=$("#id").val();
	var url = "${pageContext.request.contextPath}/crm/customer/base/shareCancelOne.jsp";
	//var url = "${pageContext.request.contextPath}/crm/companyAction_other.do?method=showShareCancelOne&id="+id;
	forward(url);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////

function do_select(id){
   if($("#sharetype").val()=='add'){
	   if(id=='c_company'){
	       if(!$("#c_company")[0].checked){
		    	   $("input[type=checkbox][name=s_module][id!=c_company]").attr("checked",null);
	       }
	   }else{
		   if($("#"+id)[0].checked){
				   $("#c_company").attr("checked","checked");
		   }
	   }
    }

   
   if($("#sharetype").val()=='minus'){
	   if(id=='c_company'){
	       if($("#c_company")[0].checked){
		    	   $("input[type=checkbox][name=s_module][id!=c_company]").attr("checked","checked");
	       }
	   }
    }
}

</script>
</head>

<body>
<form name="ActionForm" method="post" action="${pageContext.request.contextPath}/crm/companyAction_other.do" >
<input type="hidden" name="method" value="shareUpdateOne">
<input type="hidden" name="id" id="id" value="1">
<div class="mtitle">
	<div class="mtitle-row">&nbsp;</div>
		<span onClick="" class="menu_selected">共享设置</span>
		<span onClick="goCancel();" class="menu_noselect">取消共享</span>
		<span onClick="goView();" class="menu_noselect">共享查看</span>
</div>
<br/>
<div class="control">
		<select name='sharetype' id='sharetype' onChange='UnSelectAllBox("s_module")'>
		<option value='add'>增加共享</option>
		<option value='minus'>减少共享</option>
</select>
	<button type='button' class='button' onMouseOver="this.className='button_over';" onMouseOut="this.className='button';"  
	        onClick="SelectAllBox('s_module')"><img src="${pageContext.request.contextPath}/ui/images/button/mokuaiqx.png" border='0' 
	        align='absmiddle'>&nbsp;模块全选</button>
	<button type='button' class='button' onMouseOver="this.className='button_over';" onMouseOut="this.className='button';"  
	        onClick="UnSelectAllBox('s_module')"><img src="${pageContext.request.contextPath}/ui/images/button/mokuaiqbx.png" border='0' 
	        align='absmiddle'>&nbsp;模块全不选</button>
	<button type='button' class='button' onMouseOver="this.className='button_over';" onMouseOut="this.className='button';"  
	        onClick="document.ActionForm.submit();"><img src="${pageContext.request.contextPath}/ui/images/button/baocun.png" border='0' 
	        align='absmiddle'>&nbsp;保存</button>
	<button type='button' class='button' onMouseOver="this.className='button_over';" onMouseOut="this.className='button';"  
	        onClick="self.close();"><img src="${pageContext.request.contextPath}/ui/images/button/guanbi.png" border='0' 
	        align='absmiddle'>&nbsp;关闭</button>
	<font color="red"></font>
</div>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#6A82A8">
	<tr>
		<td align="center" height="25"><span class="Tabfont">xxxxxxxxxx(客户)待共享的模块</span></td>
	</tr>
</table>
<div id="border" class="border" style="padding:3px">
<fieldset style='padding:5px;clear:left;'>
<legend>
选择模块：
</legend>
<div><input type='checkbox' class='checkbox' name='s_module' value='c_company' id='c_company'  
            onclick='do_select(this.id)' >客户资料</div>
<div><input type='checkbox' class='checkbox' name='s_module' value='c_company_linkman' id='c_company_linkman'   
            onclick='do_select(this.id)'>联系人</div>
&nbsp;</fieldset>

</div>
<br>
<div class="control">
	<button type='button' class='button' onMouseOver="this.className='button_over';" onMouseOut="this.className='button';"  
	        onClick="SelectAllBox('uid')"><img src="${pageContext.request.contextPath}/ui/images/button/yonghuqx.png" border='0' align='absmiddle'>&nbsp;用户全选</button>
	<button type='button' class='button' onMouseOver="this.className='button_over';" onMouseOut="this.className='button';"  
	        onClick="UnSelectAllBox('uid')"><img src="${pageContext.request.contextPath}/ui/images/button/yonghuqbx.png" border='0' align='absmiddle'>&nbsp;用户全不选</button>
</div>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td align="center" height="25"><span class="Tabfont">xxxxxxx(客户)待共享的用户</span></td>
	</tr>
</table>
<div class="border" style="padding:3px">
	 <fieldset style='padding:5px;clear:left;'>
			    <legend>研发部</legend>

				                <div><input type='checkbox' class='checkbox' name='uid' value='6' id='uid6' onclick='' >宋丹丹</div>
			                    &nbsp;

				                <div><input type='checkbox' class='checkbox' name='uid' value='8' id='uid8' onclick='' >李世民</div>
			                    &nbsp;

				                <div><input type='checkbox' class='checkbox' name='uid' value='10' id='uid10' onclick='' >关羽</div>
			                    &nbsp;

				                <div><input type='checkbox' class='checkbox' name='uid' value='12' id='uid12' onclick='' >王刚</div>
			                    &nbsp;

				                <div><input type='checkbox' class='checkbox' name='uid' value='20' id='uid20' onclick='' >系统管理员</div>
			                    &nbsp;

			 </fieldset>
	    
			 <fieldset style='padding:5px;clear:left;'>
			    <legend>人力资源</legend>
				                <div><input type='checkbox' class='checkbox' name='uid' value='4' id='uid4' onclick='' >王永</div>
			                    &nbsp;

				                <div><input type='checkbox' class='checkbox' name='uid' value='9' id='uid9' onclick='' >赵光义</div>
			                    &nbsp;

				                <div><input type='checkbox' class='checkbox' name='uid' value='11' id='uid11' onclick='' >刘杰</div>
			                    &nbsp;
	
				                <div><input type='checkbox' class='checkbox' name='uid' value='19' id='uid19' onclick='' >许配成</div>
			                    &nbsp;
			                  
			             
			               
			             
			          
			 </fieldset>
		
  
</div>
</form>
</body>
</html>